package com.cn.qtms.controller;//类注释设置模板

import com.cn.qtms.base.controller.BaseController;
import com.cn.qtms.base.service.BaseService;
import com.cn.qtms.common.tree.Tree;
import com.cn.qtms.entity.TmSysRole;
import com.cn.qtms.service.TmSysRoleService;
import com.cn.qtms.entity.vo.sys.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Set;

/**
 * @Name:TmSysRoleController
 * @Description:
 * @Author: zhangyang
 * @Date: 2019-11-13 21:29
 **/
@RestController
@RequestMapping("role")
public class TmSysRoleController extends BaseController<TmSysRole,Long> {
    @Autowired
    TmSysRoleService service;
    @Override
    protected BaseService<TmSysRole, Long> getService() {
        return service;
    }

    @GetMapping("findRoleResource")
    public List<Tree<Resource>> findRoleResource(@RequestParam("roles") Set<String> roles ){
        return service.findRoleResource(roles);
    }
    @GetMapping("findRolePermission")
    public List<String> findRolePermission(@RequestParam("roles") Set<String> roles ){
        return service.findRolePermission(roles);
    }
}
